<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
    <style>
        #result{
            width: 400px;
            height: 300px;
            border:solid 1px #999;
        }
    </style>
</head>
<body>
    <button>点击获取数据</button>
    <div id="result"></div>
    <script>
        let btn = document.querySelector('button');
        let res = document.querySelector('#result');

        //绑定事件
        btn.onclick = async function(){
            //发送请求
            let result = await axios({
                url: 'http://192.168.43.23:8090/server'
            });

            //查看结果
            // console.log(result.data);//对象
            res.innerHTML = result.data;
        }
    </script>
</body>
</html>